<?php
/**
 * 辅助控制器
 *
 * @package     Include  (controller)
 * @author      hary <hary@taomee.com>
 * @version     $ID 2010-3-31 $
 */
class Common extends Controller
{
	private $result;
	/**
	 * 构造函数
	 */
	function __construct()
	{
		parent::__construct();

		$this->loadModel('common_model');
		$this->loadClass('Mcache');
	}
	/**
	 * 默认执行方法
	 *
	 * @return
	 */
	function index()
	{
	}
	
	/**
	 * 验证码
	 * @return unknown_type
	 */
	function verify()
	{
		$args['verify_m'] = $_GET['verify_m'];
		$args['verify_a'] = $_GET['verify_a'];
		view::display( $this->tpl, $args );
	}

	/**
	 * 用户信息设定
	 *
	 */
	function initLoginData()
	{
		$this->tpl->assign('type', strtolower($this->in_var['type']));
		$this->tpl->assign('service', strtolower($this->in_var['service']));

		if($this->user_model->isLogin())
		{
			$this->tpl->assign('hasLogin', true);
			$this->tpl->assign('uid', $_SESSION['pay']['login_info']['user_id']);
		}
	}

	/**
	 * 验证码校验
	 * @return unknown_type
	 */
	function validateYzm(){
		
		$seccode  = trim(strtolower($this->in_var['seccode']));
		$sec      = trim(strtolower($_SESSION['login_check_number']));

		if(empty($seccode)||$seccode != $sec)
		{
			echo 0;
			exit;
		}
		else
		{
			echo 1;
		}
	}

}